﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManagerProducts.aspx.cs"
    Theme="tbmobile" Inherits="ShowroomMobile.ManagerProducts" MasterPageFile="~/AdminSite.Master"
    ValidateRequest="false" Title="Product Management" %>

<%@ Register Assembly="ShowroomMobile" Namespace="jNET.Controls" TagPrefix="cc" %>
<asp:Content runat="server" ID="cManagerCategory" ContentPlaceHolderID="body">
    <a href="UpdateProduct.aspx" style='cursor: pointer'>
        <img src="images/add.png" alt="Add New Product" />
        Add New Product </a>
    <div style='height: 10px'>
        &nbsp;</div>
    <asp:UpdatePanel runat="server" ID="upProducts">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" DefaultButton="btnSearchProduct" Style="padding: 5px 0px 5px 0px;">
                <asp:TextBox runat="server" ID="txtSearchProduct" placeholder="Search" Width="200px"
                    class="txt" />&nbsp;<asp:Button runat="server" ID="btnSearchProduct" Text="Search"
                        OnClick="btnSearchProduct_Click" />
            </asp:Panel>
            <cc:CustomGrid Width="100%" AllowRowSelect="false" GridLines="None" CssClass="clientGrid"
                AllowCustomPaging="true" OnItemCommand="gridSlides_ItemCommand" ID="gridSlides"
                runat="server" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" OnPageIndexChanged="gridSlides_PageIndexChanged"
                DataKeyField="ID" OnNeedDataSource="gridSlides_OnNeedDataSource" PagerStyle-Mode="NumericPages">
                <Columns>
                    <cc:CustomTemplateField UniqueName="Name" HeaderText="Image" ItemStyle-Width="20%"
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <img src='<%# ShowroomMobile.Utilities.GetKeySetting("PathUploadImageThumb") + "/" + Eval("ImageUrl") %>'
                                class="imgAdmin" />
                        </ItemTemplate>
                    </cc:CustomTemplateField>
                    <cc:CustomTemplateField HeaderText="Name" ItemStyle-Width="50%" HeaderStyle-Width="55%">
                        <ItemTemplate>
                            <a href='ProductDetails.aspx?id=<%# Eval("ID") %>&isreview=true'>
                                <%# Eval("Name").ToString() %></a>
                        </ItemTemplate>
                    </cc:CustomTemplateField>
                    <cc:CustomTemplateField HeaderText="Price" ItemStyle-Width="30%" HeaderStyle-Width="35%">
                        <ItemTemplate>
                            <%# Convert.IsDBNull(Eval("Price")) ? "Price: Not updated" : String.Format("Price: <span class='price'>{0:C}</span>", Eval("Price"))%>
                        </ItemTemplate>
                    </cc:CustomTemplateField>
                    <cc:CustomTemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                        ItemStyle-Width="10px" HeaderStyle-Width="10px" HeaderText="Edit">
                        <ItemTemplate>
                            <a href='UpdateProduct.aspx?id=<%# Eval("ID") %>' style='cursor: pointer'>
                                <asp:Image ImageUrl="~/images/edit.png" runat="server" ID="imgDelete" />
                            </a>
                        </ItemTemplate>
                    </cc:CustomTemplateField>
                    <cc:CustomTemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                        ItemStyle-Width="10px" HeaderStyle-Width="10px" HeaderText="">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnDelete" runat="server" ToolTip="Delete" ImageUrl="~/images/delete.png"
                                OnClientClick='return confirm("Are you sure to delete this item?");' CommandName="Delete"
                                CommandArgument='<%# Eval("ID") %>' />
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:LinkButton ID="btnDeleteAll" runat="server" ToolTip="Delete All" OnClientClick='return confirm("Are you sure to delete all item(s)?");'
                                CommandName="DeleteAll">
                                <asp:Image ImageUrl="~/images/delete.png" runat="server" ID="imgDeleteAll" />
                            </asp:LinkButton>
                        </HeaderTemplate>
                    </cc:CustomTemplateField>
                </Columns>
            </cc:CustomGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
